package com.neusoft.dao;

import com.neusoft.util.MySqlProvider;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.UpdateProvider;

/**
 * @Author fa
 * @Date 9:59 2020/6/3
 */
public interface BaseDao<T> {

    /**
     * 新增数据
     *
     * @param bean 实例对象
     * @return 影响行数
     */
    @InsertProvider(type=MySqlProvider.class,method=MySqlProvider.INSERT)
    int insert(T bean);
    @UpdateProvider(type=MySqlProvider.class, method=MySqlProvider.UPDATE)
    int update(T bean);
    @DeleteProvider(type=MySqlProvider.class,method=MySqlProvider.DELETE)
    int delete(@Param("table") String table, @Param("where") String where);
//    @SelectProvider(type=MySqlProvider.class, method=MySqlProvider.queryAll)
//    List<T> queryAll(IPage<Student> page, @Param("bean") T bean);
}
